<template>
	<div class="mine">
		<div class="member-center-main">
			<div class="member-center-menu">
				<div class="info-block">
					<div class="playerid">{{info.name}}</div>
				</div>
				<div class="balance-info">
					<div class="currency">{{$t('indexTitle.title23')}}</div>
					<div class="balance">{{info.money||0}}</div>
				</div>
				<div class="nav-block">
					<div class="item" :class="tab == 0 ? 'active':''" @click="goNextPage('/mine')">
						<img src="../../assets/icons/gerenziliao.png" alt="" />
						<div class="label">{{$t('indexTitle.title24')}}</div>
					</div>
					<div class="item" :class="tab == 1 ? 'active':''" @click="goNextPage('/vipRebates')">
						<img src="../../assets/icons/vip.png" alt="" />
						<div class="label">{{$t('indexTitle.title321')}}</div>
					</div>
					<div class="item" :class="tab == 2 ? 'active':''" @click="goNextPage('/deposit')">
						<img src="../../assets/icons/chongzhi.png" alt="" />
						<div class="label">{{$t('indexTitle.title26')}}</div>
					</div>
					<div class="item" :class="tab == 3 ? 'active':''" @click="goNextPage('/withdraw')">
						<img src="../../assets/icons/tixian.png" alt="" />
						<div class="label">{{$t('indexTitle.title27')}}</div>
					</div>
					<!-- <div class="item" :class="tab == 4 ? 'active':''" @click="goNextPage('/affiliate')">
						<img src="../../assets/icons/tuiguangfenxiao.png" alt="" />
						<div class="label">{{$t('indexTitle.title28')}}</div>
					</div> -->
					<div class="item" :class="tab == 5 ? 'active':''" @click="goNextPage('/mission')">
						<img src="../../assets/icons/renwurizhi.png" alt="" />
						<div class="label">{{$t('indexTitle.title29')}}</div>
					</div>
					<div class="item" :class="tab == 6 ? 'active':''" @click="goNextPage('/promotions')">
						<img src="../../assets/icons/youhuizhongxin.png" alt="" />
						<div class="label">{{$t('indexTitle.title30')}}</div>
					</div>
					<div class="item" :class="tab == 7 ? 'active':''" @click="goNextPage('/game-history')">
						<img src="../../assets/icons/youxijilu.png" alt="" />
						<div class="label">{{$t('indexTitle.title31')}}</div>
					</div>
					<div class="item" :class="tab == 8 ? 'active':''" @click="goNextPage('/finan-history')">
						<img src="../../assets/icons/caiwujilu.png" alt="" />
						<div class="label">{{$t('indexTitle.title32')}}</div>
					</div>
					<div class="item" :class="tab == 9 ? 'active':''" @click="goNextPage('/personalMsg')">
						<img src="../../assets/icons/gonggaozhongxin.png" alt="" />
						<div class="label">{{$t('indexTitle.title33')}}</div>
					</div>
				</div>
			</div>
			<div class="member-center-content">
				<div class="member-center-profile">
					<div class="title">{{$t('indexTitle.title321')}}</div>
					<div class="proList">
						<div class="header_group">
							<div class="rebate-button" @click="getlingqu">{{$t('indexTitle.title322')}} {{info.fs_money||0}} {{$t('indexTitle.title323')}}</div>
							<div class="rebate-list">
								<div class="rebate-items">
									{{$t('indexTitle.title324')}}<span>{{info.fs_zz||0}}</span>
								</div>
								<div class="rebate-items">
									{{$t('indexTitle.title325')}}<span>{{info.fs_ty||0}}</span>
								</div>
								<div class="rebate-items">
									{{$t('indexTitle.title326')}}<span>{{info.fs_dz||0}}</span>
								</div>
								<div class="rebate-items">
									{{$t('indexTitle.title327')}}<span>{{info.fs_qp||0}}</span>
								</div>
								<div class="rebate-items">
									{{$t('indexTitle.title331')}}<span>{{info.fs_by||0}}</span>
								</div>
								<div class="rebate-items">
									{{$t('indexTitle.title332')}}<span>{{info.fs_dj||0}}</span>
								</div>
								<div class="rebate-items">
									{{$t('indexTitle.title333')}}<span>{{info.fs_dwdj||0}}</span>
								</div>
							</div>
						</div>
						<div class="txt_group">
							<h2>{{$t('indexTitle.title328')}}</h2>
							<ul>
								<li style="white-space: break-spaces;">
									<span>1.</span>{{$t('indexTitle.title329')}}
								</li>
								<li style="white-space: break-spaces;">
									<span>2.</span>{{$t('indexTitle.title330')}}
								</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<loadingFour :msgText="msgTextTow" v-if="isShowLoadingTeow" @closeGuanbiTow="closeGuanbi"></loadingFour>
	</div>

</template>

<script>
	import {
		userinfo,
		fsnow
	} from "../../utils/api.js"
	import loadingFour from '../../components/loadingFour.vue';
	export default {

		data() {
			return {
				isShowVipLe: 0,
				isJIfenShow: false,
				info: [],
				tab: 1,
				isSelLeverIt: 0,
				navList: [{
						title: this.$t('indexTitle.title180')
					}, {
						title: this.$t('indexTitle.title181')
					},
					{
						title: this.$t('indexTitle.title182')
					}
				],
				isShowNavIt: 0,
				startTime: "",
				endTime: "",
				msgTextTow: "",
				isShowLoadingTeow: false
			}
		},
		components: {
			loadingFour
		},
		created() {},
		mounted() {
			this.info = JSON.parse(localStorage.getItem('userInfo'))
			// this.getuserinfo()
		},

		methods: {
			closeGuanbi(e) {
				this.isShowLoadingTeow = false;
			},
			nowDate(time) {
				var year = time.getFullYear(); // 年
				var month = (time.getMonth() + 1).toString().padStart(2, '0'); // 月
				var date = time.getDate().toString().padStart(2, '0'); // 日
				var shi = time.getHours().toString().padStart(2, '0'); // 日
				var fen = time.getMinutes().toString().padStart(2, '0'); // 日
				var miao = time.getSeconds().toString().padStart(2, '0'); // 日
				this.startTime = year + "-" + month + "-" + date;
				this.endTime = year + "-" + month + "-" + date;
			},
			getSelNav(num) {
				this.isShowNavIt = num;
			},
			selLeverIt(index) {
				this.isSelLeverIt = index;
			},
			getuserinfo() {
				userinfo().then((res) => {
					if (res.status.errorCode == 0) {
						localStorage.setItem('userInfo', JSON.stringify(res.data))
						this.info = JSON.parse(localStorage.getItem('userInfo'))
						this.$emit('USERInfo', JSON.stringify(res.data))
					} else if (res.status.errorCode == 401) {
						this.$emit('getTokenNum', false)
						console.log('401')
					} else {
						// this.$message.error(res.status.msg);
						this.msgTextTow = res.status.msg;
						this.isShowLoadingTeow = true;
						setTimeout(() => {
							this.isShowLoadingTeow = false;
						}, 2000)
						// this.$message({
						// 	showClose: true,
						// 	message: res.status.msg,
						// 	type: 'error'
						// });
					}
				}).catch((err) => {
					console.log(err, 'err')
				});
			},
			getlingqu() {
				fsnow().then((res) => {
					if (res.status.errorCode == 0) {
						this.getuserinfo()
					} else if (res.status.errorCode == 401) {
						console.log('401')
					} else {
						// this.$message.error(res.status.msg);
						this.msgTextTow = res.status.msg;
						this.isShowLoadingTeow = true;
						setTimeout(() => {
							this.isShowLoadingTeow = false;
						}, 2000)
						// this.$message({
						// 	showClose: true,
						// 	message: res.status.msg,
						// 	type: 'error'
						// });
					}
				}).catch((err) => {
					console.log(err, 'err')
				});
			},
			getSelVipLever(num) {
				this.isShowVipLe = num;
			},
			getShowJifen() {
				this.isJIfenShow = !this.isJIfenShow;
			},
			goNextPage(page) {
				this.$router.push(page)
			},
			goBack() {
				this.$router.go(-1)
			}
		}
	}
</script>

<style scoped>
	* {
		box-sizing: border-box;
	}

	.vipjilu {
		position: fixed;
		top: 0px;
		right: 10px;
		font-size: 13px;
		color: #545658;
	}

	.proList {
		width: 100%;
		padding: 55px 15px 0;
	}

	.dengjiTi {
		width: 100%;
		color: #545658;
		font-size: 16px;
		padding-bottom: 10px;
	}

	.dengjiBoxss {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.dengjiBox {
		width: 70%;
		background: linear-gradient(135deg, #787878, #787878 50%, #878787 0, #787878);
		box-shadow: 0 3px 3px 0 rgba(0, 0, 0, .25), inset 0 -10px 25px #646464;
		border-radius: 5px;
		color: #fff;
		height: 150px;
		padding: 10px;
		display: flex;
		justify-content: space-between;
	}

	.dengjiBoxLOne {
		font-size: 12px;
	}

	.dengjiBoxLTow {
		font-size: 24px;
		font-weight: 800;
		text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
	}

	.dengjiBoxLThree {
		font-size: 16px;
		font-weight: 400;
		overflow: hidden;
		padding: 0;
		text-overflow: ellipsis;
		text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
		white-space: nowrap;
	}

	.dengjiBoxR {
		width: 130px;
		height: 130px;
	}

	.dengjiBoxR img {
		width: 100%;
		height: 100%;
	}

	.quanyiBox {
		width: 30%;
		height: 150px;
		background-color: #fafafc;
		border-radius: 5px;
		cursor: auto;
		display: flex;
		align-items: center;
		flex-direction: column;
		justify-content: center;
		position: relative;
		text-align: center;
		font-size: 14px;
		font-weight: 400;
		color: #545658;
	}

	.quanyiBox img {
		width: 122px;
		height: 122px;
	}

	.vipNavBox {
		width: 100%;
		display: flex;
		margin-top: 10px;
		align-items: center;
	}

	.vipNavBoxIt {
		width: 70px;
		height: 34px;
		align-items: center;
		border: 1px solid #888787;
		border-radius: 5px;
		color: #838383;
		display: flex;
		font-size: 18px;
		font-weight: 400;
		justify-content: center;
		margin-right: 15px;
		opacity: .5;
	}

	.vipNavBoxIt img {
		width: 30px;
		height: 30px;
		margin-right: 2px;
	}

	.vipNavBoxItTow {
		background-color: #fff;
		border: 1px solid #b5b5b5;
		color: #000;
		opacity: 1;
	}

	.vipLeverBox {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		margin: 15px 0;
		align-items: center;
	}

	.vipLeverBoxIt {
		width: 42px;
		height: 42px;
		margin-right: 5px;
		opacity: .5;
		margin-bottom: 3px;
	}

	.vipLeverBoxItTow {
		opacity: 1;
	}

	.vipLeverBoxIt img {
		width: 42px;
		height: 42px;
	}

	.jinjiBox {
		width: 100%;
		height: 40px;
		display: flex;
		align-items: center;
		padding: 0px 10px;
		justify-content: space-between;
		border: 1px solid #ececec;
		border-radius: 5px 5px 0px 0px;
	}

	.jinjiBoxL {
		font-weight: 400;
		color: #545658;
	}

	.jinjiBoxR {
		border: 1px solid #9ac143;
		color: #9ac143;
		border-radius: 100px;
		font-size: 12px;
		font-weight: 300;
		margin-left: 5px;
		padding: 4px 7px;
		white-space: nowrap;
	}

	.jinjiBoxRTow {
		border: 1px solid #e94951;
		color: #e94951;
		border-radius: 100px;
		font-size: 12px;
		font-weight: 300;
		margin-left: 5px;
		padding: 4px 7px;
		white-space: nowrap;
	}

	.jifenBoxTow {
		width: 100%;
		height: 75px;
		display: block;
		cursor: pointer;
		padding: 7px 10px 10px;
		border: 1px solid #ececec;
		border-top: none;
		border-radius: 0px 0px 5px 5px;
	}

	.jifenBoxThree {
		display: none;
	}

	.jifenBoxT {
		color: #a0a3a5;
		font-size: 14px;
		padding: 5px 0;
	}

	.jifenBoxC {
		width: 100%;
		display: flex;
		align-items: center;
		font-size: 14px;
		font-weight: 400;
		color: #545658;
		justify-content: space-between;
	}

	.jifenBoxCL span {
		color: #ff9b00;
	}

	.jinjiLineBox {
		width: 100%;
		height: 5px;
		background-color: #838383;
		border-radius: 5px;
		margin-top: 3px;
	}

	.jinjiLineBoxTow {
		width: 100%;
		height: 5px;
		border-radius: 5px;
		background-color: #ff9b00 !important;
	}

	.gengduoBox {
		background-color: #e1e1e1;
		color: #838383;
		cursor: pointer;
		font-size: 14px;
		padding: 8px 15px;
		text-align: center;
		display: none;
	}

	.gengduoBoxTow {
		display: block;
	}

	.tequanBox {
		width: 100%;
		display: flex;
		align-items: center;
	}

	.dengjiTiTow {
		margin-top: 20px;
		font-size: 17px;
		font-weight: 600;
		line-height: 24px;
		margin-bottom: 20px;
	}

	.tequanBoxIt {
		align-items: center;
		background-color: #fafafc;
		border-radius: 5px;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 10px;
		width: 35%;
		text-align: center;
	}

	.tequanBoxIt img {
		width: 64px;
		height: 64px;
	}

	.tequanBoxItTit {
		font-weight: 400;
		line-height: 22px;
		margin: 8px 0;
		max-width: 150px;
		overflow: hidden;
		text-overflow: ellipsis;
		text-align: center;
		width: 100%;
	}

	.tequanBoxItBut {
		border-radius: 3px;
		width: 100%;
		color: #fff;
		font-size: 12px;
		height: inherit;
		padding: 3px 15px;
		background-color: #7240ff;
		cursor: not-allowed;
		opacity: .4;
	}

	.tequanBoxItButTow {
		border-radius: 3px;
		width: 100%;
		color: #fff;
		font-size: 12px;
		height: inherit;
		padding: 3px 15px;
		background-color: #7240ff;
		cursor: pointer;
	}

	.tequanBoxItText {
		border-radius: 3px;
		width: 100%;
		font-size: 12px;
		height: inherit;
		padding: 3px 15px;
		cursor: not-allowed;
		background: none;
		color: #7240ff;
		opacity: 1;
	}

	.member-center-main {
		color: #545658;
		display: flex;
		justify-content: center;
		margin: 0 auto;
		max-width: 1280px;
		padding: 20px 0;
		width: 100%;
	}

	.member-center-menu {
		overflow: hidden;
		width: 220px;
		margin-top: 10px;
	}

	.info-block {
		align-items: center;
		border-bottom: 1px solid #e9e9e9;
		display: flex;
		padding: 30px 15px 15px;
	}

	.playerid {
		font-size: 22px;
		font-weight: 600;
		word-break: break-all;
	}

	.balance-info {
		align-items: flex-end;
		border-bottom: 1px solid #e9e9e9;
		display: flex;
		justify-content: space-between;
		padding: 15px;
	}

	.currency {
		padding-right: 8px;
	}

	.balance {
		font-size: 18px;
		font-weight: 500;
	}

	.nav-block {
		align-items: center;
		display: flex;
		flex-direction: column;
	}

	.item {
		align-items: center;
		box-sizing: border-box;
		color: #939698;
		cursor: pointer;
		display: flex;
		height: 60px;
		line-height: 1.4;
		padding: 0 15px;
		position: relative;
		transition: .3s ease;
		width: 100%;
	}

	.item.active {
		color: #5235ff;
	}

	.item:hover {
		color: #5235ff;
	}

	.item img {
		width: 35px;
		height: 35px;
		margin-right: 12px;
	}

	.item .label {
		font-size: 16px;
		font-weight: 500;
		line-height: 1.2;
	}

	.member-center-content {
		background: #f9f9f9;
		margin-top: 10px;
		border-radius: 10px;
		box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .15);
		display: flex;
		justify-content: space-between;
		min-height: 700px;
		overflow: hidden;
		position: relative;
		width: calc(100% - 220px);
	}

	.member-center-profile {
		padding: 24px;
		width: 50%;
		position: relative;
	}

	.title {
		color: #545658;
		margin-bottom: 25px;
		font-size: 19px;
		font-weight: 600;
		line-height: 24px;
	}

	.proList {
		width: 100%;
		padding: 0px 0px 10px;
	}
	
	.header_group {
		padding: 12px 20px  0px;
		background-color: #f3faff;
	}
	
	.rebate-button {
		display: flex;
		width: 100%;
		align-items: center;
		justify-content: center;
		margin-bottom: 20px;
		border: 1px solid #7f7f7f;
		background: #fff;
		border-radius: 12px;
		line-height: 40px;
		color: #000;
		font-size: 14px;
		cursor: pointer;
	}
	
	.rebate-list {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
	}
	
	.rebate-items {
		background-color: hsla(0, 0%, 100%, .7);
		padding: 20px 10px;
		border-radius: 9px;
		margin-bottom: 10px;
		flex-basis: 48%;
		font-size: 15px;
		color: #333;
	}
	
	.rebate-items span {
		font-weight: 500;
		margin-right: 5px;
	}
	.txt_group {
	    color: #4a4a4a;
	    background-color: #fff;
	    border-radius: 8px;
	    padding: 17px 1rem 17px;
	    width: 96%;
	    margin: 0 auto;
	}
	.txt_group h2 {
	    margin-bottom: 1rem;
		font-weight: 300;
		color: #4a4a4a;
		margin: 0 0px 15px;
		font-size: 20px;
	}
	li, ol, ul {
	    margin: 0;
	    padding: 0;
	    list-style: none;
	}
	 .txt_group ul li {
	    display: flex;
		font-size: 14px;
		color: #4a4a4a;
	    margin-bottom: 1rem;
	}
	.txt_group ul li:last-child {
		margin-bottom: 0;
	}
	 .txt_group ul li span {
	    min-width: 24px;
	    white-space: nowrap;
	}
</style>